public class h_5_1 implements Runnable {
    private h_5_demo h_5;
    public h_5_1(h_5_demo h_5){
        this.h_5=h_5;
    }
    @Override
    public void run() {
        synchronized (h_5.o){
            while(h_5.getCount()<=52){
                while(h_5.isFlag()==true){
                    try {
                        h_5.o.wait();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
                System.out.print(h_5.getCount());
                System.out.print(h_5.getCount()+1);
                h_5.setCount(h_5.getCount()+2);
                h_5.setFlag(true);
                h_5.o.notify();
            }
        }
    }
}
